package esdclibrarysystem;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author shou1dwe
 */
public class Input {

    public String getString(String display){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            print(String.format("Please Enter [%s]: ",display.toUpperCase()));
            try {
                String input = br.readLine();
                if(input!=null&&!input.equals("")){
                    return input;
                }
            } catch (IOException ex) {
                Logger.getLogger(Input.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    private void print(String output){
        System.out.println(output);
    }

}
